/*
 * Copyright 2025 arisgo@163.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.arisgo.cloud.auth.sys.entity;

import com.arisgo.cloud.web.model.NumberIdWithTime;
import com.mybatisflex.annotation.Table;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 客户端表
 *
 * @author Arisgo
 * @since 2024-06-14
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Table("auth_client")
public class Client extends NumberIdWithTime {

    /**
    * 客户端id
    */
    private String clientId;
    /**
    * 客户端密钥
    */
    private String clientSecret;
    /**
    * 资源集合
    */
    private String resourceIds;
    /**
    * 授权范围
    */
    private String scope;
    /**
    * 授权类型
    */
    private String authorizedGrantTypes;
    /**
    * 回调地址
    */
    private String webServerRedirectUri;
    /**
    * 权限
    */
    private String authorities;
    /**
    * 令牌过期秒数
    */
    private Integer accessTokenValidity;
    /**
    * 刷新令牌过期秒数
    */
    private Integer refreshTokenValidity;
    /**
    * 附加说明
    */
    private String additionalInformation;
    /**
    * 自动授权
    */
    private String autoapprove;
    /**
    * 创建部门
    */
    private Long createDept;
    /**
    * 状态
    */
    private Integer status;

    public static final String CLIENT_ID = "client_id";
    public static final String CLIENT_SECRET = "client_secret";
    public static final String RESOURCE_IDS = "resource_ids";
    public static final String SCOPE = "scope";
    public static final String AUTHORIZED_GRANT_TYPES = "authorized_grant_types";
    public static final String WEB_SERVER_REDIRECT_URI = "web_server_redirect_uri";
    public static final String AUTHORITIES = "authorities";
    public static final String ACCESS_TOKEN_VALIDITY = "access_token_validity";
    public static final String REFRESH_TOKEN_VALIDITY = "refresh_token_validity";
    public static final String ADDITIONAL_INFORMATION = "additional_information";
    public static final String AUTOAPPROVE = "autoapprove";
    public static final String CREATE_DEPT = "create_dept";
    public static final String STATUS = "status";
}
